home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / moreisbetter / mib-libraries / moretextutils / moretextutils.h < prev   
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.4 KB  |  78 lines

  1. /*
  2.     File:        MoreTextUtils.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by:    Pete Gontier
  7.  
  8.     Copyright:    Copyright (c) 1998 Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.  
  20.          <3>     21/4/99    Quinn   Added ValidStringListHandle.
  21.          <2>    11/11/98    PCG     fix headers
  22.          <1>    11/10/98    PCG     first big re-org at behest of Quinn
  23.  
  24.     Old Change History (most recent first):
  25.  
  26.          <5>    10/11/98    Quinn   Convert "MorePrefix.h" to "MoreSetup.h".
  27.          <4>    10/23/98    PCG     add GetPascalStringFromLongDouble
  28.          <3>      9/9/98    PCG     re-work import and export pragmas
  29.          <2>     7/24/98    PCG        coddle linker (C++, CFM-68K)
  30.          <1>     6/16/98    PCG     initial checkin
  31. */
  32.  
  33. #pragma once
  34.  
  35. #include "MoreSetup.h"
  36.  
  37. #include <TextUtils.h>
  38. #include <fp.h>
  39.  
  40. typedef struct
  41. {
  42.     UInt16                count;
  43.     ConstStr255Param    list [ ];
  44.  
  45.     // followed by packed strings from 'STR#' resource
  46. }
  47. *tStringListP, **tStringListH;
  48.  
  49. #ifdef __cplusplus
  50.     extern "C" {
  51. #endif
  52.  
  53. #pragma import on // for clients
  54. #pragma export on // for building a library
  55.  
  56. pascal OSErr    GetPascalStringFromLongDouble    (long double, SInt8 precision, StringPtr);
  57.  
  58. pascal OSErr    GetNewStringList                (short resID, tStringListP *newStringList);
  59.  
  60. pascal OSErr    NewStringListHandle                (Handle *); // can use DisposeHandle to dispose
  61.  
  62. pascal OSErr    AppendStringToListHandle        (ConstStr255Param, Handle);
  63.  
  64. pascal Boolean    ValidStringListHandle(Handle stringList);
  65.     // Return true if stringList is a valid string list (STR#).
  66.     // This is useful when you get a string list out of a resource
  67.     // (such as a preferences file) and you want to make sure that
  68.     // you can safely operate on it with the other string list routines
  69.     // in this file.
  70.  
  71. pascal OSErr    NewStringPtr                    (ConstStr255Param, UInt8 maxSize, StringPtr *result);
  72.  
  73. #pragma import reset // for clients
  74. #pragma export reset // for building a library
  75.  
  76. #ifdef __cplusplus
  77.     }
  78. #endif